#include <iostream>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;

int main() {
  Mat src = imread("../images/2.jpg");
  if (src.empty()) {
    cout << "could not load image.." << endl;
    return -1;
  }
  namedWindow("opencv setup demo", CV_WINDOW_AUTOSIZE);
  imshow("opencv setup demo", src);

  Mat dst1, dst2;

  char src_title[] = "sourceimage";
  char dst_title1[] = "image1";
  char dst_title2[] = "image2";
  /*
    int top = static_cast<int>(0.05 * src.rows);
    int bottom = static_cast<int>(0.05 * src.rows);
    int left = static_cast<int>(0.05 * src.cols);
    int right = static_cast<int>(0.05 * src.cols);
    int borderType = BORDER_DEFAULT;
    Mat dst;
    RNG rng(12345);

    int c = 0;
    while (true) {
      c = waitKey(500);
      if (static_cast<char>(c) == 27) {
        break;
      }

      if (static_cast<char>(c) == 'r') {
        borderType = BORDER_REPLICATE;
      } else if (static_cast<char>(c) == 'w') {
        borderType = BORDER_WRAP;
      } else if (static_cast<char>(c) == 'c') {
        borderType = BORDER_CONSTANT;
      } else {
        borderType = BORDER_DEFAULT;
      }
      Scalar color =
          Scalar(rng.uniform(0, 255), rng.uniform(0, 255), rng.uniform(0, 255));
      copyMakeBorder(src, dst, top, bottom, left, right, borderType, color);
      imshow("xxx", dst);
    }

    */
  Mat dst;
  GaussianBlur(src, dst, Size(5, 5), 0, 0, BORDER_CONSTANT);
  imshow("yyy", dst);

  Mat dstx;
  GaussianBlur(src, dstx, Size(5, 5), 0, 0, BORDER_REPLICATE);
  imshow("xxx", dstx);

  waitKey(0);
  return 0;
}